<div class="row justify-content-center">
    <div class="col-8">
        <form name="editForm" role="form" novalidate (ngSubmit)="save()" [formGroup]="editForm">
            <h2 id="jhi-location-heading">Create or edit a Location</h2>

            <div>
                <jhi-alert-error></jhi-alert-error>

                <div class="form-group" [hidden]="!editForm.get('id')!.value">
                    <label for="id">ID</label>
                    <input type="text" class="form-control" id="id" name="id" formControlName="id" readonly />
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_streetAddress">Street Address</label>
                    <input type="text" class="form-control" name="streetAddress" id="field_streetAddress"
                           formControlName="streetAddress"/>
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_postalCode">Postal Code</label>
                    <input type="text" class="form-control" name="postalCode" id="field_postalCode"
                           formControlName="postalCode"/>
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_city">City</label>
                    <input type="text" class="form-control" name="city" id="field_city"
                           formControlName="city"/>
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_stateProvince">State Province</label>
                    <input type="text" class="form-control" name="stateProvince" id="field_stateProvince"
                           formControlName="stateProvince"/>
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_country">Country</label>
                    <select class="form-control" id="field_country" name="country" formControlName="countryId">
                        <option [ngValue]="null"></option>
                        <option [ngValue]="countryOption.id" *ngFor="let countryOption of countries; trackBy: trackById">{{ countryOption.id }}</option>
                    </select>
                </div>
            </div>

            <div>
                <button type="button" id="cancel-save" class="btn btn-secondary" (click)="previousState()">
                    <fa-icon icon="ban"></fa-icon>&nbsp;<span>Cancel</span>
                </button>

                <button type="submit" id="save-entity" [disabled]="editForm.invalid || isSaving" class="btn btn-primary">
                    <fa-icon icon="save"></fa-icon>&nbsp;<span>Save</span>
                </button>
            </div>
        </form>
    </div>
</div>
